home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / ThreadRunn60422382002.psc / BGTRDemo / DBWorks DLL / Classes / CBGTRUserQuerys.cls < prev   
Encoding:
Visual Basic class definition  |  2002-03-03  |  2.9 KB  |  99 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "CBGTRUserQuerys"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
  15. Attribute VB_Ext_KEY = "Collection" ,"CBGTRUserQuery"
  16. Attribute VB_Ext_KEY = "Member0" ,"CBGTRUserQuery"
  17. Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
  18. '********************************************************************************************
  19. '   CBGTRUserQuerys Collection Class Definition
  20. '   Class defines collection to contain UserQuery class instances
  21. '   Standard VB collection implementation, with additional Insert method
  22. '
  23. '   Instancing is set to:  5 - MultiUse
  24. ''
  25. '********************************************************************************************
  26. Option Explicit
  27.  
  28. Private mCol As Collection
  29.  
  30. Public Sub Insert(ByRef oUserQuery As CBGTRUserQuery, Optional sKey As String = vbNullString)
  31.  
  32.     If Len(sKey) = 0 Then
  33.         mCol.Add oUserQuery
  34.     Else
  35.         mCol.Add oUserQuery, sKey
  36.     End If
  37.  
  38. End Sub
  39.  
  40. Public Function Add(ReturnsRecords As ReturnsRecords_enum, ParameterCount As Long, ADOParameters As Variant, SQLStatement As String, QueryType As QueryType_enum, Connection As CDBConnection, DBType As DBType_enum, Optional sKey As String) As CBGTRUserQuery
  41. Dim objNewMember As CBGTRUserQuery
  42.     
  43.     Set objNewMember = New CBGTRUserQuery
  44.  
  45.     'set the properties passed into the method
  46.     objNewMember.ReturnsRecords = ReturnsRecords
  47.     objNewMember.ParameterCount = ParameterCount
  48.     objNewMember.ADOParameters = ADOParameters
  49.     objNewMember.SQLStatement = SQLStatement
  50.     objNewMember.QueryType = QueryType
  51.     objNewMember.DBType = DBType
  52.    
  53.     If IsObject(Connection) Then
  54.         Set objNewMember.Connection = Connection
  55.     Else
  56.         objNewMember.Connection = Connection
  57.     End If
  58.     
  59.     If Len(sKey) = 0 Then
  60.         mCol.Add objNewMember
  61.     Else
  62.         mCol.Add objNewMember, sKey
  63.     End If
  64.  
  65.     'return the object created
  66.     Set Add = objNewMember
  67.     Set objNewMember = Nothing
  68.  
  69. End Function
  70.  
  71. Public Property Get Item(vntIndexKey As Variant) As CBGTRUserQuery
  72. Attribute Item.VB_UserMemId = 0
  73.   On Error Resume Next
  74.   Set Item = mCol(vntIndexKey)
  75. End Property
  76.  
  77. Public Property Get Count() As Long
  78.     Count = mCol.Count
  79. End Property
  80.  
  81. Public Sub Remove(vntIndexKey As Variant)
  82.     mCol.Remove vntIndexKey
  83. End Sub
  84.  
  85. Public Property Get NewEnum() As IUnknown
  86. Attribute NewEnum.VB_UserMemId = -4
  87. Attribute NewEnum.VB_MemberFlags = "40"
  88.     Set NewEnum = mCol.[_NewEnum]
  89. End Property
  90.  
  91. Private Sub Class_Initialize()
  92.     Set mCol = New Collection
  93. End Sub
  94.  
  95. Private Sub Class_Terminate()
  96.     Set mCol = Nothing
  97. End Sub
  98.  
  99.